
<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/10/25
 * Time: 10:01
 */
?>

<div class="yx-clear">
    <label class="zx-label">会员名称</label>
    <div class="zx-field-floatl">
        <?=\yii\helpers\Html::encode($customer->name)?>
</div>
</div>
<div class="yx-clear">
    <label class="zx-label">账户余额</label>
    <div class="zx-field-floatl">
        <?= \yii\helpers\Html::encode(isset($BAccout)?$BAccout->cash:0); ?>
    </div>
</div>
<?= $form ?>

<div class="yx-clear">
    <label class="zx-label">合计</label>
    <div class="zx-field-floatl">
        <span id="customer-charge-count">0</span>
    </div>
</div>
<?= \Yii::$app->view->registerJs("
        $('input').focusout(function () {
            rg = /^(([1-9][\d]*)(\.[\d]{1,3})?)|(0\.[\d]{1,3})$/;
            var num = 0;
            $('input').each(function () {
                if (rg.test($(this).val())) {
                    ha = $(this).val();
                    num =parseFloat(ha)+num;
                }
            });
            $('#customer-charge-count').html('¥'+num);
        });
    "); ?>